/*
 * claplan_target.h
 *
 *  Created on: 2 Nov 2013
 *      Author: Tom Vercauteren
 */

#ifndef CLAPLAN_TARGET_H_
#define CLAPLAN_TARGET_H_

#include <string>
#include <vector>
#include "dvhp.h"

struct ClaplanTargetMask
{
	unsigned char name :1;
	unsigned char tcp_model :1;
	unsigned char tcp_name :1;
	unsigned char impf :1;
	unsigned char pf_inhom :1;
	unsigned char pf_rms :1;
	unsigned char pf_rmsdiff :1;
	unsigned char dvhps :1;
	unsigned char pf_ihlf :1;
	unsigned char pfs_olf :1;
	unsigned char tracer :1;
	unsigned char impf_pet :1;
	unsigned char rimpf_petd :1;
	unsigned char pet_low :1;
	unsigned char dose_low :1;
	unsigned char pet_high :1;
	unsigned char dose_high :1;
	unsigned char c_pf_inhom :1;
	unsigned char c_pf_rms :1;
	unsigned char cmi :1;
};

class ClaplanTarget
{
private:
	/** Mask to determine which parameters have been set and which haven't.*/
	ClaplanTargetMask mask;
	/** anastruct name */
	std::string name;
	/** tcp model */
	std::string tcp_model;
	/** tcp namel */
	std::string tcp_name;
	/** importance factor */
	double impf;

	/** physical inhomogeneity */
	double pf_inhom;
	/** physical root mean square */
	double pf_rms;
	/** physical root mean square difference*/
	double pf_rmsdiffs[2];

	double pf_ihlf[3];
	double pfs_olf[3];

	/** tracer name */
	std::string tracer;
	/** importance factor of the PET signal */
	double impf_pet;
	double rimpf_petd;
	/** low PET signal */
	double pet_low;
	/** dose mapped to the pet_low */
	double dose_low;
	/** high PET signal */
	double pet_high;
	/** dose mapped to the pet_high */
	double dose_high;

	double c_pf_inhom;
	double c_pf_rms;
	double cmi[2];
public:
	/** list of DVH points */
	std::vector<Dvhp> dvhps;

	ClaplanTarget();
	ClaplanTarget(const ClaplanTarget &ct);
	~ClaplanTarget();

	ClaplanTarget& operator=(const ClaplanTarget &ct);

	friend std::ostream & operator<<(std::ostream & os,
			const ClaplanTarget &target);

	double getCPfInhom() const;
	void setCPfInhom(double c_pf_inhom);
	void unsetCPfInhom();
	unsigned char isCPfInhomSet() const;

	double getCPfRms() const;
	void setCPfRms(double c_pf_rms);
	void unsetCPfRms();
	unsigned char isCPfRmsSet() const;

	void setCmi(const double *cmi);
	const double* getCmi() const;
	void unsetCmi();
	unsigned char isCmiSet() const;

	double getDoseHigh() const;
	void setDoseHigh(double doseHigh);
	void unsetDoseHigh();
	unsigned char isDoseHighSet() const;

	double getDoseLow() const;
	void setDoseLow(double doseLow);
	void unsetDoseLow();
	unsigned char isDoseLowSet() const;

	double getImpf() const;
	void setImpf(double impf);
	void unsetImpf();
	unsigned char isImpfSet() const;

	double getImpfPet() const;
	void setImpfPet(double impfPet);
	void unsetImpfPet();
	unsigned char isImpfPetSet() const;

	const std::string& getName() const;
	void setName(const std::string& name);
	void unsetName();
	unsigned char isNameSet() const;

	double getPetHigh() const;
	void setPetHigh(double petHigh);
	void unsetPetHigh();
	unsigned char isPetHighSet() const;

	double getPetLow() const;
	void setPetLow(double petLow);
	void unsetPetLow();
	unsigned char isPetLowSet() const;

	const double* getPfIhlf() const;
	void setPfIhlf(const double *pf_ihlf);
	void unsetPfIhlf();
	unsigned char isPfIhlfSet() const;

	double getPfInhom() const;
	void setPfInhom(double pfInhom);
	void unsetPfInhom();
	unsigned char isPfInhomSet() const;

	double getPfRms() const;
	void setPfRms(double pf_rms);
	void unsetPfRms();
	unsigned char isPfRmsSet() const;

	const double* getPfRmsdiffs() const;
	void setPfRmsdiffs(const double *pf_rmsdiffs);
	void unsetPfRmsdiffs();
	unsigned char isPfRmsdiffsSet() const;

	const double* getPfsOlf() const;
	void setPfsOlf(const double *pfs_olf);
	void unsetPfsOlf();
	unsigned char isPfsOlfsSet() const;

	double getRimpfPetd() const;
	void setRimpfPetd(double rimpfPetd);
	void unsetRimpfPetd();
	unsigned char isRimpfPetdSet() const;

	const std::string& getTcpModel() const;
	void setTcpModel(const std::string& tcpModel);
	void unsetTcpModel();
	unsigned char isTcpModelSet() const;

	const std::string& getTcpName() const;
	void setTcpName(const std::string& tcpName);
	void unsetTcpName();
	unsigned char isTcpNameSet() const;

	const std::string& getTracer() const;
	void setTracer(const std::string& tracer);
	void unsetTracer();
	unsigned char isTracerSet() const;
};

#endif /* CLAPLAN_TARGET_H_ */
